//
//  HJZuduiCell.m
//  project
//
//  Created by hu on 2019/3/27.
//  Copyright © 2019 健健. All rights reserved.
//

#import "HJZuduiCell.h"
#import "HJChatTextMsgModel.h"
#import "YFJourneyModel.h"

@interface HJZuduiCell ()

/*
 * 父视图切圆角
 */
@property (weak, nonatomic) IBOutlet UIView *zuduiCycleView;
/*
 * 时间
 */
@property (weak, nonatomic) IBOutlet UILabel *time;
/*
 * 位置
 */
@property (weak, nonatomic) IBOutlet UILabel *location;
/*
 * 查看详情
 */
@property (weak, nonatomic) IBOutlet UIButton *checkDetailBtn;
@property (weak, nonatomic) IBOutlet UIImageView *leftImage;
@property (weak, nonatomic) IBOutlet UIImageView *rightImage;

@end

@implementation HJZuduiCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    [self.contentView setupShadowWithView:self.zuduiCycleView];
    [self.leftImage rounded:UIRectCornerAllCorners radius:20 borderColor:[UIColor blackColor] borderWidth:1];
    [self.rightImage rounded:UIRectCornerAllCorners radius:20 borderColor:[UIColor blackColor] borderWidth:1];
    @weakify(self)
    [[self.checkDetailBtn rac_signalForControlEvents:UIControlEventTouchUpInside] subscribeNext:^(__kindof UIControl * _Nullable x) {
        @strongify(self)
        self.clicked();
    }];
}

/*
 * 查看详情点击事件
 */
- (IBAction)checkBtnClicked:(UIButton *)sender {
    
}

-(void)loadData:(HJSimpleModel *)model {
    self.location.text = [NSString stringWithFormat:@"见面地点：%@",model.data.team.startText];
    [self.leftImage sd_setImageWithURL:model.data.user.avatarURL placeholderImage:setImage(@"img_mydongtai_defualt_avatar")];
    [self.rightImage sd_setImageWithURL:model.data.userB.avatarURL placeholderImage:setImage(@"img_mydongtai_defualt_avatar")];
}

@end
